#include "render/RendererAPI.h"
#include "render/OpenGL/OpenGLBuffer.h"

#include "Buffer.h"

namespace Cogs {
	std::shared_ptr<VertexBuffer> VertexBuffer::Create(uint32_t size) {
		switch (RendererAPI::GetAPIType()) 
		{
			case RendererAPIType::OpenGL:return std::make_shared<OpenGLVertexBuffer>(size); break;
			case RendererAPIType::None:
				__debugbreak();
				return nullptr;
				break;
		}

		return nullptr;
	}

	std::shared_ptr<VertexBuffer> VertexBuffer::Create(float* vertices, uint32_t size) {
		switch (RendererAPI::GetAPIType()) 
		{
			case RendererAPIType::OpenGL:return std::make_shared<OpenGLVertexBuffer>(vertices, size); break;
			case RendererAPIType::None:
				__debugbreak();
				return nullptr;
				break;
		}
		return nullptr;
	}

	std::shared_ptr<IndexBuffer> IndexBuffer::Create(uint32_t* indices, uint32_t count) {
		switch (RendererAPI::GetAPIType()) 
		{
			case RendererAPIType::OpenGL:return std::make_shared<OpenGLIndexBuffer>(indices, count); break;
			case RendererAPIType::None:
				__debugbreak();
				return nullptr;
				break;
		}

		return nullptr;
	}
}